﻿
//const publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8i4A2sDSSlQV2AWoQL3daVOLD2d0Uts1WdBYLCWX4gW80XDIDXaDkGUoxIF2YzVzleycdTS3qdA0nub3q7MWRu7LEMv6VvMKplLjLmNIo6Vt/ebGvawk6jUxxavlckQ7+0Yd8H3GBbCUEIEcdDx9asgkBeIH+XS4wALnTMAoSuwIDAQAB";
//const privateKey = "MIICXAIBAAKBgQC8i4A2sDSSlQV2AWoQL3daVOLD2d0Uts1WdBYLCWX4gW80XDIDXaDkGUoxIF2YzVzleycdTS3qdA0nub3q7MWRu7LEMv6VvMKplLjLmNIo6Vt/ebGvawk6jUxxavlckQ7+0Yd8H3GBbCUEIEcdDx9asgkBeIH+XS4wALnTMAoSuwIDAQABAoGAdbHnMTxBNRdNN2KeoMfgi0Td4UAIX7vU5hjFAdK2ErBJiLfciHlTy891nsEDbDUVvjJoMkRRWz9iTuAFi7aNhN8ErOacaPm7i6ejlYVRKPFdQsDkUU3mwd69D0uj9bHz7ba0iBhSG5vqW5pCHKxBJDeEkQyTRFtA24J7bfPTbUECQQDeiJsXaWM0ekRItE6lao8Weqfu5ADXSZu2RdMlmCz239E/atMht7/gHv5p50ou7NciKnqnd8PLQQNs7FdFlRlxAkEA2OZacosTOxKiRsdEw5rGMxtjP9FVzg6LEadzrVlEl0h5NYjv8okidxK6dEU5Er9ob/AYMwuMsSgw/9dX5ss46wJAOiG1YghFwg+uhs+TO+L6PgUMmXs2PQcdhh/3aHq4REVzg/2D6er2VLXEACZLWrbD/EjcgaLnotD49BtJMQQiAQJAWI0S+BiXbVKaNdM8267gpBTWXEOWiF2foUGAFJGRU0IfWh/h9l7OV1aqELYCKwlCFhErkAtzERCbkJfWJz9oqQJBAMOEt+2WJf+QNK7uuXbqw9AFrqAnFIekwgAA3gSLfRBd2WiO3jo2hqdH5qO5Ca0s4yLURwvki+7ch/Auwy5Vpj0=";

encrypt = function (txt) {
    const encryptor = new JSEncrypt() 
    encryptor.setPublicKey(publicKey)
    return encryptor.encrypt(txt)
}
decrypt = function (txt) {
    const decryptor = new JSEncrypt() 
    decryptor.setPrivateKey(privateKey) 
    return decryptor.decrypt(txt)
}